#pragma once

#include "qlib/core/export.h"
#include <memory>
#include <string>
#include <vector>
#include <entt/entt.hpp>

namespace qlib {
class Project;
class Library;
class Cell;

class QLIB_API QEDA_Internals {
 public:
  static QEDA_Internals* getInstance();


  int createProject(const std::string& describe,const std::string& name);
  std::shared_ptr<Project> findProject(const std::string& describe, const std::string& name);
  void removeProject(std::shared_ptr<Project> project);

  std::shared_ptr<Library> loadOasFile(const std::string& describe,const std::string& project_name, const std::string& libaray_name,const std::string& fileName);
  int writeOasFile(const std::string& describe,const std::string& project_name, const std::string& libaray_name, const std::string& name);


  std::shared_ptr<Library> loadGdsFile(const std::string& describe,const std::string& project_name, const std::string& fileName);
    int writeGdsFile(const std::string& describe,const std::string& project_name, const std::string& libaray_name, const std::string& name);
  std::shared_ptr<Library> findLibrary(const std::string& describe,const std::string& project_name, const std::string& libaray_name);
  std::shared_ptr<Library> findLibrary(std::shared_ptr<Cell> t_cell);
  void deleteLibrary(std::shared_ptr<Library> t_lib);


  std::shared_ptr<Cell> getCell(const std::string& describe, const std::string& project_name, const std::string& libaray_name,
                                            const std::string& cell_name);

 private:
  QEDA_Internals();
  ~QEDA_Internals();
  static QEDA_Internals* qeda;

  std::vector<std::shared_ptr<Project>> m_projects;
};
}  // namespace QedaKernel